<? include_once("../../../common/common_setting_unit.php"); //引入通用的设置文件?>
<? include_once("../controller/collect.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <? include_once(ROOT_PATH_ . "/controller/common/module/head.php"); ?>
    <link href="../asset/css/member.css"      rel="stylesheet" type="text/css"/>
</head>


<body>

<div id="topbar">     <?php include ROOT_PATH_ . '/controller/common/module/topbar.php'; ?> </div>


<div id="container" class="<? echo $system_part ?>">

    <div id="maincontent">

        <div id="sidebar">
            <?php include ROOT_PATH_ . '/controller/common/module/sidebar.php'; ?>
        </div>


<div id="content" class="layui-form">
<h1>商机统计</h1>




<div class="detail-box  layui-form">
    <table class="layui-table">
        <colgroup>
            <col >
            <col >
            <col >
            <col >
            <col >
            <col >
        </colgroup>
        <thead>
        <tr>
            <th>姓名</th>
            <th>跟进中项目</th>
            <th>跟进总额</th>
            <th>成功</th>
            <th>成功金额</th>
            <th>失败</th>
            <th>失败金额</th>
        </tr>
        </thead>
        <tbody>


        <?php for ($i = 0; $i < count($data['employee']); $i++) {?>

        <tr id="item<? echo $data['data_list'][$i]['nid'] ?>">

            <td> <? echo $employee[$data['employee'][$i]] ?> </td>
            <td><?echo count_with_2_key_in_2d_array($data['opportunity'],"principal",$data['employee'][$i],"status","跟进中")?></td>
            <td><?
                //$array二维数组，key，需要统计的键值（项）
                $p['array'] = $data['opportunity_ing'];
                $p['condition_key'] = "principal";
                $p['condition_value'] = $data['employee'][$i];
                $p['condition_range']="==";
                $p['target'] = 'price';
                 $result=sum_with_key_by_value_in_2d_array($p);
                echo $result['sum']?>
            </td>

            <td><?echo count_with_2_key_in_2d_array($data['opportunity'],"principal",$data['employee'][$i],"status","成功")?></td>
            <td><?
                //$array二维数组，key，需要统计的键值（项）
                $p['array'] = $data['opportunity_success'];
                $p['condition_key'] = "principal";
                $p['condition_value'] = $data['employee'][$i];
                $p['condition_range']="==";
                $p['target'] = 'price';
                $result=sum_with_key_by_value_in_2d_array($p);
                echo $result['sum']?>
            </td>
            <td><?echo count_with_2_key_in_2d_array($data['opportunity'],"principal",$data['employee'][$i],"status","失败")?></td>
            <td><?
                //$array二维数组，key，需要统计的键值（项）
                $p['array'] = $data['opportunity_failure'];
                $p['condition_key'] = "principal";
                $p['condition_value'] = $data['employee'][$i];
                $p['condition_range']="==";
                $p['target'] = 'price';
                $result=sum_with_key_by_value_in_2d_array($p);
                echo $result['sum']?>
            </td>
        </tr>
        <?}?>
        </tbody>
    </table>
</div>


<!--maincontent端點01-->
<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>


<?php include_once($_SERVER['DOCUMENT_ROOT']."/controller/common/module/footer.php")?>

</body>
 
</html>